import request from '@/utils/request'
import qs from 'qs'

// 查询流程定义信息列表
export function listBpmnInfo(query) {
	return request({
		url: '/workflow/bpmnInfo/list',
		method: 'get',
		params: query
	})
}

// 删除流程定义信息
export function delBpmnInfo(id) {
	return request({
		url: '/workflow/bpmnInfo/' + id,
		method: 'delete'
	})
}

// 获取 流程图/流程文件 资源
export function getResource(id, type) {
	return request({
		url: '/workflow/bpmnInfo/resource/' + id,
		method: 'get',
		params: {type}
	})
}

// 流程部署
export function deploy(formData) {
	return request({
		url: '/workflow/bpmnInfo/deploy',
		method: 'post',
		data: formData,
		headers: {
			'Content-type': 'multipart/form-data'
		}
	})
}
